import 'package:self32/generated/json/base/json_convert_content.dart';
import 'package:self32/entity/inventory_entity.dart';

InventoryEntity $InventoryEntityFromJson(Map<String, dynamic> json) {
	final InventoryEntity inventoryEntity = InventoryEntity();
	final String? reader = jsonConvert.convert<String>(json['reader']);
	if (reader != null) {
		inventoryEntity.reader = reader;
	}
	final String? uid = jsonConvert.convert<String>(json['uid']);
	if (uid != null) {
		inventoryEntity.uid = uid;
	}
	final String? epc = jsonConvert.convert<String>(json['epc']);
	if (epc != null) {
		inventoryEntity.epc = epc;
	}
	final String? scanCount = jsonConvert.convert<String>(json['scan_count']);
	if (scanCount != null) {
		inventoryEntity.scanCount = scanCount;
	}
	final String? blockData = jsonConvert.convert<String>(json['block_data']);
	if (blockData != null) {
		inventoryEntity.blockData = blockData;
	}
	final List<InventoryAnts>? ants = jsonConvert.convertListNotNull<InventoryAnts>(json['ants']);
	if (ants != null) {
		inventoryEntity.ants = ants;
	}
	return inventoryEntity;
}

Map<String, dynamic> $InventoryEntityToJson(InventoryEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['reader'] = entity.reader;
	data['uid'] = entity.uid;
	data['epc'] = entity.epc;
	data['scan_count'] = entity.scanCount;
	data['block_data'] = entity.blockData;
	data['ants'] =  entity.ants?.map((v) => v.toJson()).toList();
	return data;
}

InventoryAnts $InventoryAntsFromJson(Map<String, dynamic> json) {
	final InventoryAnts inventoryAnts = InventoryAnts();
	final dynamic? no = jsonConvert.convert<dynamic>(json['no']);
	if (no != null) {
		inventoryAnts.no = no;
	}
	final dynamic? count = jsonConvert.convert<dynamic>(json['count']);
	if (count != null) {
		inventoryAnts.count = count;
	}
	return inventoryAnts;
}

Map<String, dynamic> $InventoryAntsToJson(InventoryAnts entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['no'] = entity.no;
	data['count'] = entity.count;
	return data;
}